/**
 * 最大升序子数组和
 *
 * @USER: Administrator
 * @DATE: 2024/9/28 下午12:43
 * @VERSION: 1.0.0
 */
public class LC1800 {
    public static void main(String[] args) {

    }

    public int maxAscendingSum(int[] nums) {
        int maxSum = nums[0];
        int sum = nums[0];
        for (int i = 1; i < nums.length; i++) {
            if(nums[i] > nums[i-1]) {
                sum += nums[i];
                if(sum > maxSum) {
                    maxSum = sum;
                }
            }else {
                sum = nums[i];
            }
        }
        return maxSum;
    }

}
